qx.Class.define("qx.ui.form.ow.TextFilter",
{
	extend : qx.ui.core.Widget,
	construct : function (label)
	{
		this.base(arguments);

		this._setLayout(new qx.ui.layout.VBox(1));
		
		var conW = new qx.ui.container.Composite(new qx.ui.layout.HBox(1));
		this._label = new qx.ui.basic.Label(label).set({width:120, rich:true});
		this._text = new qx.ui.form.TextField().set({width:200, focusable:true});
		
		conW.add(this._label);
		conW.add(this._text);

		this.__opacity = 0.0;
		this._list = new qx.ui.form.List().set({height:80, opacity:this.__opacity});
		
		this._add(conW);
		this._add(this._list);
		
		this.addListener("activate", function ()
		{
			if (this.__opacity === 0)
			{
				this.__efect = true;
			}
			else
			{
				this.__efect = false;
			}
			this.__timer.restart();
		}, this);
		
		this._text.addListener("input", function ()
		{
			this.fireEvent("activate");
		}, this);

		this.__timer = new qx.event.Timer(150);
		this.__timer.addListener('interval', function(e)
		{
			if (this.__efect)
				this.__opacity += 0.2;
			else
				this.__opacity -= 0.2;

			this.__opacity = Math.round((parseFloat(this.__opacity))*10)/10;
			
//			this.debug(this.__opacity);
				
			this._list.setOpacity(this.__opacity);
			if ((this.__opacity === 1) || (this.__opacity === 0))
			{
				this.__timer.stop();
			}
		}, this);
		
	},
	members :
	{
	}
});